package cn.edu.hizee.gps.model;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "t_action_node", schema = "EHelp", catalog = "")
public class ActionNode {
    private int id;
    private int pid;
    private String urlName;
    private String url;
    private int level;
    private String iconClass;
    private int sortId;
    private byte isMenu;
    private byte isShow;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "pid")
    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }

    @Basic
    @Column(name = "url_name")
    public String getUrlName() {
        return urlName;
    }

    public void setUrlName(String urlName) {
        this.urlName = urlName;
    }

    @Basic
    @Column(name = "url")
    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Basic
    @Column(name = "level")
    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    @Basic
    @Column(name = "icon_class")
    public String getIconClass() {
        return iconClass;
    }

    public void setIconClass(String iconClass) {
        this.iconClass = iconClass;
    }

    @Basic
    @Column(name = "sort_id")
    public int getSortId() {
        return sortId;
    }

    public void setSortId(int sortId) {
        this.sortId = sortId;
    }

    @Basic
    @Column(name = "is_menu")
    public byte getIsMenu() {
        return isMenu;
    }

    public void setIsMenu(byte isMenu) {
        this.isMenu = isMenu;
    }

    @Basic
    @Column(name = "is_show")
    public byte getIsShow() {
        return isShow;
    }

    public void setIsShow(byte isShow) {
        this.isShow = isShow;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ActionNode that = (ActionNode) o;
        return id == that.id &&
                pid == that.pid &&
                level == that.level &&
                sortId == that.sortId &&
                isMenu == that.isMenu &&
                isShow == that.isShow &&
                Objects.equals(urlName, that.urlName) &&
                Objects.equals(url, that.url) &&
                Objects.equals(iconClass, that.iconClass);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, pid, urlName, url, level, iconClass, sortId, isMenu, isShow);
    }
}
